package com.ecable.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ecable.daoImpl.ProfileDAO;
import com.ecable.bean.ProfileTO;
import com.ecable.util.LoggerManager;

public class UpdateAction extends HttpServlet {

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * This method is called when a form has its tag value method equals to get.
	 * 
	 * @param request the request send by the client to the server
	 * @param response the response send by the server to the client
	 * @throws ServletException if an error occurred
	 * @throws IOException if an error occurred
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		String target="UpdateProfile.jsp?status=Updation Failed"; 
		//try{
			String username=(String)request.getSession().getAttribute("user");
		 ProfileTO rb = new ProfileTO(); 
	    rb.setPhoto(request.getParameter("photo"));
        rb.setFirstName(request.getParameter("firstName")); 
        rb.setLastName(request.getParameter("lastName")); 
     
        rb.setEmail(request.getParameter("email"));
        rb.setFax(request.getParameter("fax"));
        //home
        String home=request.getParameter("homeaddresstype");
       
        //office
        String office=request.getParameter("officeaddresstype");
       
      
        //contact
        String contact=request.getParameter("personaladdresstype");
       
       
    
        
       /* boolean flag=new ProfileDAO().modifyProfile(rb);
        
        if(flag) 
           target = "UpdateProfile.jsp?status=Updation Success"; 
        else  
            target = "UpdateProfile.jsp?status=Updation Failed"; 
            }catch(Exception e)
            {
            	e.printStackTrace();
            	}
            
        RequestDispatcher rd = request.getRequestDispatcher(target);
        rd.forward(request,response);
	*/
}}

